﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SMTC.Dao.Report;
using SMTC.Model.Domain;
using SMTC.Model.Model;
using SMTC.BO.Common;
using System.Data.Common;

namespace SMTC.BO.Report
{
    public class ReportService
    {
        private ReportDao _dao = new ReportDao();

        /// <summary>
        /// 获取BU的月份详细需求
        /// </summary>
        /// <param name="BuName"></param>
        /// <returns></returns>
        public List<ReportDataSourceModel> GetReportPlan(string BuName, string PlanVersion)
        {
            return _dao.GetReportPlan(BuName, PlanVersion);
        }

        /// <summary>
        /// 获取BU的月份详细需求
        /// </summary>
        /// <param name="BuName"></param>
        /// <returns></returns>
        public List<ImportPlanDomain> GetReportPlan(string PlanVersion)
        {
            return _dao.GetReportPlan(PlanVersion);
        }

        /// <summary>
        /// 获取BU的月份详细需求
        /// </summary>
        /// <param name="BuName"></param>
        /// <returns></returns>
        public List<ImportPlanDomain> GetReportPlan_T(string PlanVersion)
        {
           return _dao.GetReportPlan_T(PlanVersion);
        }

        /// <summary>
        /// 获取BU的月份详细能力
        /// </summary>
        /// <param name="BuName"></param>
        /// <returns></returns>
        public List<ReportDataSourceModel> GetReportCapacity(string BuName, DateTime start, DateTime end, string PUVersion)
        {
            start = DbValueProccess.DateTimeProccess(start);
            end = DbValueProccess.DateTimeProccess(end, false);
            return _dao.GetReportCapacity(BuName, start, end, PUVersion);
        }

        /// <summary>
        /// 获取BU的月份详细能力
        /// </summary>
        /// <param name="BuName"></param>
        /// <returns></returns>
        public List<ImportPlanDomain> GetReportCapacity(DateTime start, DateTime end, string PUVersion)
        {
            start = DbValueProccess.DateTimeProccess(start);
            end = DbValueProccess.DateTimeProccess(end, false);
            return _dao.GetReportCapacity(start, end, PUVersion);
        }

        public int GetMountByMonth(ImportPlanDomain item, int month)
        {
            return _dao.GetMountByMonth(item, month);
        }


    }
}
